﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DBUtility;

public partial class Control_ProductHorizontalBar : System.Web.UI.UserControl
{
    #region 封装字段
    private string ifIndex;

    public string IfIndex
    {
        get { return ifIndex; }
        set { ifIndex = value; }
    }
    #endregion


    protected void Page_Load(object sender, EventArgs e)
    {
        ControlDataInit();
    }


    #region ControlDataInit
    protected void ControlDataInit()
    {
        try
        {
            string SQLstr_ProductIndex = "SELECT * FROM [Product] WHERE [Product_IsLock]=false AND [Product_IsDel]=false ";

            if (this.IfIndex != "False")
            {
                SQLstr_ProductIndex += "AND [Product_Index]=true ";
            }
            
            SQLstr_ProductIndex += "ORDER BY [Product_Order] DESC";

            DataTable DT_ProductIndex = AccHelper.GetDataTable(SQLstr_ProductIndex);

            DL_HorizontalList.DataSource = DT_ProductIndex.DefaultView;

            DL_HorizontalList.DataBind();
        }
        catch (Exception ex)
        {
            LB_ProductHorizontalBar.Text = ex.Message;
        }
    }
    #endregion
}
